package com.example.activity;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ShowActivity extends Activity {
    private TextView tv_phone;
    private TextView tv_number;
    private TextView tv_passward;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show);
        //获取到Intent对象
        Intent intent = getIntent();
        //取出key对应的value值
        String phone = intent.getStringExtra("phone");
        String number = intent.getStringExtra("number");
        String passward = intent.getStringExtra("passward");
        tv_phone = (TextView) findViewById(R.id.tv_phone);
        tv_number = (TextView) findViewById(R.id.tv_number);
        tv_passward = (TextView) findViewById(R.id.tv_passward);
        tv_phone.setText(phone + "");
        tv_number.setText(number + "");
        tv_passward.setText(passward + "");


        //打开手机浏览器百度页面
        //打开的按钮
        Button button = (Button) findViewById((R.id.button));
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                //设置动作为android.intent.action.VIEW
                intent.setAction("android.intent.action.VIEW");
                //设置要打开的网址
                intent.setData(Uri.parse("http://WWW.baidu.com"));
                startActivity(intent);
            }
        });

        Button button2 = (Button) findViewById((R.id.button2));
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq");
                startActivity(intent);
            }
        });

        Button button3 = (Button) findViewById((R.id.button3));
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = getPackageManager().getLaunchIntentForPackage("com.tencent.tmgp.sgame");
                startActivity(intent);
            }
        });
    }

}
